import { Injectable } from '@angular/core';
import { Router } from '@angular/router';
import {ReplaySubject} from 'rxjs';
import {HttpClient} from '@angular/common/http';

@Injectable()
export class MenuService {
    private current: ReplaySubject<any> = new ReplaySubject<any>( 1 );
    private currentTitle: ReplaySubject<any> = new ReplaySubject<any>( 1 )
    constructor(
      private router: Router,
      private http:HttpClient
    ) {}
    
    public setCurrent( menu: any ) {
      this.current.next( menu );
    }

    public getCurrent() {
      return this.current;
    }

    public setCurrentTitle(menutitle:any){
      this.currentTitle.next(menutitle)
    }

    public getCurrentTitle(){
      return this.currentTitle
    }
}
